package com.example.softbank;

import java.beans.PropertyDescriptor;
import java.lang.reflect.Field;
import java.lang.reflect.Method;

public class Test {

	public static void main(String[] args) {
		invokeTest();
	}

	public static void invokeTest() {
		try {
			TestBean bean = new TestBean();
			Class<?> clazz = bean.getClass();
			Field[] fields = clazz.getDeclaredFields();
			for (Field field : fields) {
				PropertyDescriptor descriptor = new PropertyDescriptor(field.getName(), clazz);
				Method method = descriptor.getWriteMethod();
				method.invoke(bean, "test");
			}
			System.out.println(bean.getName());
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	public static void test() {
		String requestMessage = "63      IF27WBK0F92B06C2FB037C8734476CCD4AC2B99A652322199204020539  6235668989301726728             hmsh";
		SocketClient client = new SocketClient("30.1.12.200", 3999, requestMessage);
		String resp = client.sendMessage();
		System.out.println(resp);
	}
}
